package com.spic.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spic.common.core.annotation.Excel;

import java.time.LocalDate;
import java.util.Date;

/**
 * 流水号历史对象 sys_number_history
 * 
 * @author spic
 * @date 2021-11-02
 */
public class SysNumberHistory
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 编号规则id */
    @Excel(name = "编号规则id")
    private Long sysNumberConfigId;

    /** 最大序列号 */
    @Excel(name = "最大序列号")
    private Long maxNumber;

    /** 前缀 */
    @Excel(name = "前缀")
    private String prefix;

    /** 中缀 */
    @Excel(name = "中缀")
    private String infix;

    /** 后缀 */
    @Excel(name = "后缀")
    private String suffix;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private Integer year;
    private Integer month;
    private Integer day;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setSysNumberConfigId(Long sysNumberConfigId) 
    {
        this.sysNumberConfigId = sysNumberConfigId;
    }

    public Long getSysNumberConfigId() 
    {
        return sysNumberConfigId;
    }
    public void setMaxNumber(Long maxNumber)
    {
        this.maxNumber = maxNumber;
    }

    public Long getMaxNumber()
    {
        return maxNumber;
    }
    public void setPrefix(String prefix) 
    {
        this.prefix = prefix;
    }

    public String getPrefix() 
    {
        return prefix;
    }
    public void setInfix(String infix) 
    {
        this.infix = infix;
    }

    public String getInfix() 
    {
        return infix;
    }
    public void setSuffix(String suffix) 
    {
        this.suffix = suffix;
    }

    public String getSuffix() 
    {
        return suffix;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public Integer getMonth() {
        return month;
    }

    public void setMonth(Integer month) {
        this.month = month;
    }

    public Integer getDay() {
        return day;
    }

    public void setDay(Integer day) {
        this.day = day;
    }

    public SysNumberHistory() {
    }

    @Override
    public String toString() {
        return "SysNumberHistory{" +
                "id=" + id +
                ", sysNumberConfigId=" + sysNumberConfigId +
                ", maxNumber=" + maxNumber +
                ", prefix='" + prefix + '\'' +
                ", infix='" + infix + '\'' +
                ", suffix='" + suffix + '\'' +
                ", updateTime=" + updateTime +
                ", year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }

    public void initDate(LocalDate now) {
        this.year = now.getYear();
        this.month = now.getMonthValue();
        this.day = now.getDayOfMonth();
    }
}
